<%--
  @author Kusal Samarakoon
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<script type="text/javascript">

    $(function () {

    });


</script>

<div id="land-registration-module-home-title" class="module-home-title">
    <s:a href="landAlienationModuleHome.do"><img src="${pageContext.request.contextPath}/images/interest-party.png"
                                                 alt="Land Registration"><span><s:label
            value="%{getText('land_alienation.label')}"/></span></s:a>
    <span class="module-title-breaker"> </span>

    <div id="back-button" align="right">
        <s:submit type="input" value="%{getText('back.label')}" onclick="goBack();"/>
    </div>

</div>
<%--class="form-outer"--%>
<div id="init-land-permits-application-outer">
    <h3>Attach Alienation Documents</h3>
</div>

<s:form method="POST" id="gov-land-attach-doc-form"
        name="gov-land-attach-doc-form" enctype="multipart/form-data"
        onsubmit="javascript:return validateFormForInputDataSyntaxErrors('gov-land-attach-doc-form')">
    <table>

        <tr>
            <td><s:label value="%{getText('doc.label')}"/></td>
            <td align="left-align" colspan="2"><s:include value="../documentUploadView.jsp"/></td>
        </tr>
        <tr>
            <s:if test="#session.userGroup !='ords'">
                <td><s:label value="%{getText('sign_status.label')}" cssClass="mandatory-field"/></td>
                <td align="left" colspan="4">
                    <s:radio id="isSign" name="signOrNot"
                             list="#@java.util.HashMap@{'1':getText('sign.label'),'0':getText('notsign.label')}"
                             value="1"/>

                </td>
            </s:if>
        </tr>

            <%--<tr>
                <td>
                    <s:label value="Comments"/>
                </td>
                <td><s:textarea id="commentId" name="landApplication.comment"
                                cssClass="width-595-px"/></td>
            </tr>--%>


        <s:if test="landApplication.comment.length() >0">
            <tr>
                <td>
                    <s:label value="%{getText('comments_history.label')}"/>
                </td>
                <td><s:textarea id="commentId" name="landApplication.comment"
                                cssClass="width-595-px" readonly="true"/></td>
            </tr>
        </s:if>

        <s:if test="#session.userGroup=='ords'">
            <tr>
                <td>
                    <s:label value="Comments"/>
                </td>
                <td><s:textarea id="viewcommentId" name="comment"
                                cssClass="width-595-px"/></td>
            </tr>
        </s:if>


        <tr>
            <td colspan="2">
                <s:if test="#session.userGroup =='ords'">
                    <s:submit value="%{getText('approve.label')}" action="approveSignDocApplication"/>
                    <s:submit value="%{getText('reject_button.label')}" action="rejectAttachedAlienationDoc"/>
                    <s:submit value="%{getText('cancel.label')}" action="home"/>
                </s:if>
                <s:elseif test="landApplication.workflowItem.workflowTask == @lk.icta.core.entity.WorkflowTask@SIGNED_PRINTED_ALIENATION_DOCUMENT ||
                landApplication.workflowItem.workflowTask == @lk.icta.core.entity.WorkflowTask@UNSIGNED_PRINTED_ALIENATION_DOCUMENT">
                    <s:submit value="%{getText('approve.label')}" action="approveSignDocApplication"/>
                    <s:submit value="%{getText('reject_button.label')}" action="rejectAttachedAlienationDoc"/>
                    <s:submit value="%{getText('cancel.label')}" action="home"/>
                </s:elseif>
                <s:else>
                    <%--<s:submit value="Signed" action="saveAttachedAlienationDoc"/>
                    <s:submit value="Not Signed" action="saveAttachedAlienationDoc"/>--%>
                    <s:submit value="%{getText('save.label')}" action="saveAttachedAlienationDoc"/>
                    <s:submit value="%{getText('cancel.label')}" action="initApplicationAgreement"/>

                </s:else>
                <s:hidden name="landApplication.id"/>
                <s:hidden name="editMode" value="22"/>

            </td>
        </tr>
    </table>
</s:form>

